package br.com.ufrn.aipetro.ga.domain.entity.device.sensor.sensorlevel;

import java.util.Date;

import br.com.ufrn.aipetro.ga.domain.entity.device.Critical;
import br.com.ufrn.aipetro.ga.domain.entity.device.OperationStatus;
import br.com.ufrn.aipetro.ga.domain.entity.device.Protocol;
import br.com.ufrn.aipetro.ga.domain.entity.device.sensor.Sensor;
import br.com.ufrn.aipetro.ga.domain.entity.mesh.Mesh;

public class SensorLevel extends Sensor {
    
    public static final String LEVEL_PROPERTY = "level";
    public static final String LENGTH_MAX_PROPERTY = "lengthMax";
   

    private float level;
    private float lengthmax;
   
    public SensorLevel() {
    	super();

    }

    /**
     * 
     * @param level
     * @param lengthmax
     * @param name
     * @param operationTemperature
     * @param range
     * @param sampleRate
     * @param deviceId
     * @param serialNumber
     * @param model
     * @param manufacturer
     * @param mesh
     * @param tag
     * @param operationStatus
     * @param protocol
     * @param critical
     * @param dateOperationStart
     * @param dateOperationFinish
     */
	public SensorLevel(float level, float lengthmax, String name, float operationTemperature, float range,
			float sampleRate, String deviceId, String serialNumber,
			String model, String manufacturer, Mesh mesh, String tag,
			OperationStatus operationStatus, Protocol protocol,
			Critical critical, Date dateOperationStart, Date dateOperationFinish) {
		
		
		super(name, operationTemperature, range, sampleRate, deviceId, serialNumber,
				model, manufacturer, mesh, tag, operationStatus, protocol, critical,
				dateOperationStart, dateOperationFinish);
		
		this.level = level;
		this.lengthmax = lengthmax;
	}

	/**
     * @return the level
     */
    public float getLevel() {
            return level;
    }
   
    /**
     * @return the lengthmax
     */
    public float getLengthMax() {
            return lengthmax;
    }

    /**
     * @param level the level to set
     */
    public void setLevel(float level) {
            float oldLevel = this.level;
            this.level = level;
           
            firePropertyChange(LEVEL_PROPERTY, oldLevel, level);
    }

    /**
     * @param lengthmax the lengthmax to set
     */
    public void setLengthMax(float lengthmax) {
            float oldLengthMax = this.lengthmax;
            this.lengthmax = lengthmax;
           
            firePropertyChange(LENGTH_MAX_PROPERTY, oldLengthMax, lengthmax);
    }
}

